package admin

import (
	"api/internal/model"

	"github.com/gogf/gf/v2/frame/g"
)

type RegisterReq struct {
	g.Meta        `path:"/register" tags:"注册" method:"post" summary:"用户注册"`
	Username      string `json:"username" v:"required#用户名不能为空" dc:"用户名"`
	UserPassword  string `json:"userpassword" v:"required|length:6,30#请输入密码|密码长度不够" dc:"密码"`
	UserPassword2 string `json:"userpassword2" v:"required|length:6,30|same:userpassword#请确认密码|密码长度不够|两次密码不一致" dc:"密码"`
	UserSalt      string `json:"userSalt"`
}

// RegisterRes 注册返回数据结构
type RegisterRes struct {
	g.Meta `mime:"application/json"`
	Token  string `json:"token" dc:"token"`
}

type SayReq struct {
	g.Meta    `path:"/say" tags:"注册" method:"get" summary:"用户注册"`
	Username  string `json:"username" v:"required#用户名不能为空" dc:"用户名"`
	Password  string `json:"password1" v:"required|length:6,30#请输入密码|密码长度不够" dc:"密码"`
	Password2 string `json:"password2" v:"required|length:6,30|same:password2#请确认密码|密码长度不够|两次密码不一致" dc:"密码"`
}

// SayRes 注册返回数据结构
type SayRes struct {
	g.Meta      `mime:"application/json"`
	UserInfo    *model.UserLoginOutput `json:"userInfo" dc:"用户信息"`
	Token       string                 `json:"token" dc:"token"`
	MenuList    []interface{}          `json:"menuList" dc:"菜单列表"`
	Permissions []string               `json:"permissions" dc:"权限列表"`
}
